package com.jshongli.myapplication.common.utils;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

/**
 * 备注：     java类作用描述
 * 创建时间:     2019/9/10 18:39
 */
public class MyDialog extends Dialog {
    //    style引用style样式
    public MyDialog(Context context, int width, int height, View layout, int style, int grative) {

        super(context, style);

        setContentView(layout);

        Window window = getWindow();

        WindowManager.LayoutParams params = window.getAttributes();

        params.height = height;
        params.width = width;

        params.gravity = grative;//Gravity.CENTER;

        window.setAttributes(params);
    }
}
